package com.ruoyi.project.system.history.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.utils.uniquekey.IdGererateFactory;
import com.ruoyi.project.system.history.mapper.MemberGoodsHistoryMapper;
import com.ruoyi.project.system.history.domain.MemberGoodsHistory;
import com.ruoyi.project.system.history.service.IMemberGoodsHistoryService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 用户足迹Service业务层处理
 * 
 * @author LCL
 * @date 2020-12-17
 */
@Service
public class MemberGoodsHistoryServiceImpl implements IMemberGoodsHistoryService 
{
    @Autowired
    private IdGererateFactory idGererateFactory;
    @Autowired
    private MemberGoodsHistoryMapper memberGoodsHistoryMapper;

    /**
     * 查询用户足迹
     * 
     * @param id 用户足迹ID
     * @return 用户足迹
     */
    @Override
    public MemberGoodsHistory selectMemberGoodsHistoryById(String id)
    {
        return memberGoodsHistoryMapper.selectMemberGoodsHistoryById(id);
    }

    /**
     * 查询用户足迹列表
     * 
     * @param memberGoodsHistory 用户足迹
     * @return 用户足迹
     */
    @Override
    public List<MemberGoodsHistory> selectMemberGoodsHistoryList(MemberGoodsHistory memberGoodsHistory)
    {
        return memberGoodsHistoryMapper.selectMemberGoodsHistoryList(memberGoodsHistory);
    }

    /**
     * 新增用户足迹
     * 
     * @param memberGoodsHistory 用户足迹
     * @return 结果
     */
    @Override
    public int insertMemberGoodsHistory(MemberGoodsHistory memberGoodsHistory)
    {
        memberGoodsHistory.setId(this.idGererateFactory.nextStringId());
        return memberGoodsHistoryMapper.insertMemberGoodsHistory(memberGoodsHistory);
    }

    /**
     * 修改用户足迹
     * 
     * @param memberGoodsHistory 用户足迹
     * @return 结果
     */
    @Override
    public int updateMemberGoodsHistory(MemberGoodsHistory memberGoodsHistory)
    {
        return memberGoodsHistoryMapper.updateMemberGoodsHistory(memberGoodsHistory);
    }

    /**
     * 删除用户足迹对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMemberGoodsHistoryByIds(String ids)
    {
        return memberGoodsHistoryMapper.deleteMemberGoodsHistoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户足迹信息
     * 
     * @param id 用户足迹ID
     * @return 结果
     */
    @Override
    public int deleteMemberGoodsHistoryById(String id)
    {
        return memberGoodsHistoryMapper.deleteMemberGoodsHistoryById(id);
    }

    @Override
    public List<String> findDayList(String uid) {
        return memberGoodsHistoryMapper.findDayList(uid);
    }

    @Override
    public List<Map> findGoodsListByUidAndDay(String uid, String day) {
        return memberGoodsHistoryMapper.findGoodsListByUidAndDay(uid,day);
    }
}
